/**
 * <strong>Title : StatisticData.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.qm.model<br>
 * </strong> <strong>Description : </strong>@类注释说明写在此处@<br>
 * <strong>Create on : 2015年12月21日 下午3:53:52<br>
 * </strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 * <br>
 * <br>
 */
package cn.b.sky.mes.qm.model;


/**
 * <strong>Title : StatisticData.java<br></strong>
 * <strong>Package : cn.b.sky.mes.qm.model<br></strong>
 * <strong>Description : </strong>统计数据，用于分类统计质量日报<br> 
 * <strong>Create on : 2015年12月21日 下午3:53:52<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人 | 修改日期 | 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public class StatisticData implements Comparable<StatisticData> {

  private String typeName;

  private String code;

  private String text;

  private Integer count;

  private String createDateTime;

  private String percentage;

  /** 
  * @return code
  */
  public String getCode() {
    return code;
  }

  /** 
  * @param code 要设置的 code
  */
  public void setCode(String code) {
    this.code = code;
  }

  /** 
  * @return text
  */
  public String getText() {
    return text;
  }

  /** 
  * @param text 要设置的 text
  */
  public void setText(String text) {
    this.text = text;
  }

  /** 
  * @return typeName
  */
  public String getTypeName() {
    return typeName;
  }

  /** 
  * @param typeName 要设置的 typeName
  */
  public void setTypeName(String typeName) {
    this.typeName = typeName;
  }

  /** 
  * @return count
  */
  public Integer getCount() {
    return count;
  }

  /** 
  * @param count 要设置的 count
  */
  public void setCount(Integer count) {
    this.count = count;
  }

  /** 
  * @return createDateTime
  */
  public String getCreateDateTime() {
    return createDateTime;
  }

  /** 
  * @param createDateTime 要设置的 createDateTime
  */
  public void setCreateDateTime(String createDateTime) {
    this.createDateTime = createDateTime;
  }

  /** 
  * @return percentage
  */
  public String getPercentage() {
    return percentage;
  }

  /** 
  * @param percentage 要设置的 percentage
  */
  public void setPercentage(String percentage) {
    this.percentage = percentage;
  }

  //根据日期排序
  @Override
  public int compareTo(StatisticData o) {
    return this.getText().compareTo(o.getText());
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((code == null) ? 0 : code.hashCode());
    result = prime * result + ((count == null) ? 0 : count.hashCode());
    result = prime * result + ((createDateTime == null) ? 0 : createDateTime.hashCode());
    result = prime * result + ((percentage == null) ? 0 : percentage.hashCode());
    result = prime * result + ((text == null) ? 0 : text.hashCode());
    result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    StatisticData other = (StatisticData) obj;
    if (code == null) {
      if (other.code != null) {
        return false;
      }
    } else if (!code.equals(other.code)) {
      return false;
    }
    if (count == null) {
      if (other.count != null) {
        return false;
      }
    } else if (!count.equals(other.count)) {
      return false;
    }
    if (createDateTime == null) {
      if (other.createDateTime != null) {
        return false;
      }
    } else if (!createDateTime.equals(other.createDateTime)) {
      return false;
    }
    if (percentage == null) {
      if (other.percentage != null) {
        return false;
      }
    } else if (!percentage.equals(other.percentage)) {
      return false;
    }
    if (text == null) {
      if (other.text != null) {
        return false;
      }
    } else if (!text.equals(other.text)) {
      return false;
    }
    if (typeName == null) {
      if (other.typeName != null) {
        return false;
      }
    } else if (!typeName.equals(other.typeName)) {
      return false;
    }
    return true;
  }

}
